<?php
/**
 * User: yuesir
 * Date: 2016/4/26
 * Time: 23:49
 */
namespace Lib;

class Database {
    private static $db;

    private function __construct()
    {

    }

    /**
     * 通过单例模式来实现数据库连接，避免资源浪费
     * @return Database
     */
    public static function getInstance()
    {
        if(!self::$db) {
            self::$db = new self();
        }
        return self::$db;
    }

    function where()
    {
        return $this;
    }

    function order()
    {
        return $this;
    }
    function limit()
    {
        return $this;
    }
}